<style lang="less">
  .itemApp1App1{
    height: 32px;
    line-height: 32px;
  }
  .row-left{
    text-align: center;
  }
  .title{
    margin-bottom:10px;
    color: #1C86EE;
    font-size: 1rem;
    border-bottom: 1px solid orangered;
    font-size: 20px;
    color: coral;
  }
  .info-middleApp{
    height: 410px;
    background-color: #F8F8FF;
    padding-left: 70px;
    padding-right: 70px;
  }
  .ivu-steps-item {
    display: initial;
    position: relative;
    vertical-align: initial;
  }
  .step-item {
    float: left;
    margin-left: 0px;
  }
  .head-img {
    height: 120px;
    width:100px;
    position:absolute;
    right:1px;
    top:10px;
  }
  .red-name{
    color: red
  }
</style>
<template>
  <div style="background-color:white">
    <div style="background-color:white">
      <Row class="title">
        <Col span="4" style="text-align: left;width:22%">动态变更救助对象</Col>
      </Row>
    </div>
    <div style="height:30px;">
      <Steps :current="1" style="margin-bottom:10px" size="small">
        <div @click="nextStep('0')" class="step-item">
          <Step title="家庭信息" content=""></Step>
        </div>
        <div @click="nextStep('1')" class="step-item">
          <Step title="死亡停救受理" content=""></Step>
        </div>
      </Steps>
    </div>
    <div class="info-middleApp">
      <div style="width:100%;">
        <Form :label-width="0" style="padding-top:10px">
          <FormItem>
            <Row class="itemApp1">
              <Col span="5" style="text-align: center" class="row-left">停保原因</Col>
              <Col span="7">
                <Select v-model="data.ssca0030">
                  <Option :value="obj.key" v-for="obj in data1" v-bind:key="obj.key">{{obj.value}}</Option>
                </Select>
              </Col>
            </Row>
          </FormItem>
          <FormItem>
            <Row class="itemApp1">
              <Col span="5" style="text-align: center" class="row-left red-name">停保原因说明</Col>
              <Col span="7">
                <Input v-model="data.ssca0035" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder=""></Input>
              </Col>
            </Row>
          </FormItem>
        </Form>
      </div>
      <div style="height:40px;line-height:40px;float:left;margin-top:10px;margin-left:25%">
        <Button type="info" @click="save()">提交申请️</Button>
      </div>
    </div>
  </div>
</template>
<script>
import { getAppraising, createPostNew } from '@/api/eventlist'
export default {
  data () {
    return {
      ss17001Id: this.$route.params.ss17001Id,
      str: this.$route.params.serialNumber,
      idcardNumber: this.$route.params.idcardNumber,
      url: 'dbtb/submitAssistanceInfo',
      data: {
        ss17001Id: this.$route.params.ss17001Id,
        ssca0030: '',
        ssca0035: '',
        name: this.$route.params.name,
        mobile: this.$route.params.mobile,
        cardno: this.$route.params.idcardNumber
      },
      data1: []
    }
  },
  methods: {
    nextStep (step) {
      var params = {
        serialNumber: this.$route.params.serialNumber,
        idcardNumber: this.$route.params.idcardNumber
      }
      this.$router.push({
        name: 'stopinsurance',
        params: params
      })
    },
    save: function () {
      console.log(this.data)
      var param1 = {
        'request_map': this.data,
        'headers_map': {
          'serialNumber': this.str,
          'idcardNumber': this.idcardNumber
        },
        'url': this.url
      }
      console.log(param1)
      createPostNew(param1).then(res => {
        console.log(res, '停保保存返回的数据')
        this.$Message.success(res.data.data.memo)
        this.$router.push({
          name: 'mainv3'
          // params: {
          //   ss11001Id: this.data.ss11001Id || res.data.data.data.ss11001Id,
          //   ss11002Id: this.data.ss11002Id || res.data.data.data.ss11002Id,
          //   idcardNumber: this.idcardNumber,
          //   serialNumber: this.str
          // }
        })
      })
    }
  },
  mounted () {
    console.log(this.str, this.idcardNumber, this.$route.params.ss17001Id)
    var param = {
      'idcardNumber': this.idcardNumber,
      'dictsCode': 'ss12001',
      'serialNumber': this.str
    }
    getAppraising(param).then(res => {
      this.data1 = res.data.data.data.StopInsuranceReasonDict
      console.log(res, '调用接口返回来的数据')
      // console.log(this.data1)
    })
  }
}
</script>
